package com.example.milimili;

import androidx.annotation.NonNull;
import androidx.appcompat.app.AppCompatActivity;
import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentManager;
import androidx.fragment.app.FragmentTransaction;
import androidx.viewpager2.widget.ViewPager2;

import android.os.Bundle;
import android.view.View;

import com.google.android.material.tabs.TabLayout;
import com.google.android.material.tabs.TabLayoutMediator;

public class MainActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        initFragStatic();
        initFragment();

    }

    private void initFragStatic() {
        for(int i=0;i<10;i++)
        {
            FragmentAdapter.tabBoolList[i]=true;
        }
        for(int i=10;i<15;i++)
        {
            FragmentAdapter.tabBoolList[i]=false;
        }
    }

    private void initFragment() {
        FragmentManager fm=getSupportFragmentManager();
        FragmentTransaction fragmentTransaction=fm.beginTransaction();
        fragmentTransaction.replace(R.id.frameLayout,new MainFragment());
//        fragmentTransaction.replace(R.id.bottomLayout,new FragmentBottom());
        fragmentTransaction.commit();
    }
}